var app=new Vue({
    el:"#app",
    data:{
        list:new Array("吃饭","睡觉","打豆豆"),
        reverseList:null,
        element:null,
        isRead:true,
        info:null,
        preInfo:null,
        infoChange:false
    },
    methods:{
        addList:function(){
            if(this.element!=null && this.element!="")
                this.list.push(this.element);
            this.elmReset();
            this.reverse();
        },
        reverse:function(){
            this.reverseList=this.list.slice().reverse();
        },
        add:function(str){
            this.list.push(str);
        },
        elmReset:function(){
            this.element=null;
        },
        removeList:function(index){
            this.list.splice(index,1);
        },
        clear:function(){
            this.list=[]
        },
        saveFile:function(){
            
        },
        readList:function(){
            var json=require("./static/list.json");
            this.list=json;
            this.isRead=false;
        },
        setInfo:function(msg){
            this.Info=msg;
        },
        setInfo:function(){
            this.info=this.preInfo.slice();
            this.desCancel();
        },
        clearInfo:function(){
            this.Info=null;
        },
        showText:function(){
            this.infoChange=true;
            this.$nextTick(function(){
                this.$refs.inputVal.focus();
            })
        },
        infoEsc:function(){
            this.infoChange=false;
        },
        desCancel:function(){
            this.preInfo=null;
            this.infoEsc();
        }
    }
})
function reload(){
    this.app.reverse();
}